package demo.practice.competition;

import java.util.HashSet;
import java.util.Set;

public class P5161 {


    public int canBeTypedWords(String text, String brokenLetters) {
        if(text==null|| text.length()==0)
            return 0;

        Set<Character> brokens= new HashSet<>();
        for (char c : brokenLetters.toCharArray()) {
                brokens.add(c);
        }

        String[] s1 = text.split(" ");
        int sum= s1.length;
        for (String s : s1 ){

            for (char c : s.toCharArray()) {
                if(brokens.contains(c)){
                    sum--;
                    break;
                }
            }
        }
        return sum;
    }
}
